package java19_1_4;

/**
 * @author yuisama
 * @date 2022/01/04 21:12
 **/
public class Animal {
    protected String name;
    protected int age;
    public Animal() {}
    public Animal(String name,int age) {
        this.name = name;
        this.age = age;
    }
    // 包访问权限
    void eat(String food) {
        System.out.println("动物" + "正在吃 "+food);
    }
    public Animal func() {
        return new Cat();
    }
}